import fetch from 'utils/fetch';
/**
 * 学校管理
 */
//查询代理商列表
export function findAgentsByPage(page,rows,provinceId,cityId,areaId,account,userName,phone,status) {
    const data = {
        provinceId,
        cityId,
        areaId,
        account,
        userName,
        phone,
        status
    };
    return fetch({
        url: 'bos/agent/findAgentsByPage/'+page+'/'+rows,
        method: 'post',
        data
    });
  }
//添加代理商
export function saveAgent(userName,account,password,phone,orgRegionMaps) {
    const data = {
        userName,
        account,
        password,
        phone,
        orgRegionMaps
    };
    return fetch({
        url: 'bos/agent/saveAgent',
        method: 'post',
        data
    });
  }
//查询代理商代理区域
export function findAgentAreaByOrgUserId(orgUserId) {
    const data = {

    };
    return fetch({
        url: 'bos/agent/findAgentAreaByOrgUserId/'+orgUserId,
        method: 'post',
        data
    });
  }
//删除代理商代理区域
export function removeAgentAreaById(areaId) {
    const data = {
        
    };
    return fetch({
        url: 'bos/agent/removeAgentAreaById/'+areaId,
        method: 'post',
        data
    });
}
//修改代理商信息
export function modifyAgent(id,userName,account,phone,orgRegionMaps) {
    const data = {
        id,
        userName,
        account,
        phone,
        orgRegionMaps
    };
    return fetch({
        url: 'bos/agent/modifyAgent',
        method: 'post',
        data
    });
}
//禁用/启用账号
export function updateAgent(status,id) {
    const data = {
        id,
        status
    };
    return fetch({
        url: 'bos/agent/updateAgent',
        method: 'post',
        data
    });
}
//添加代理商区域
export function saveAgentArea(id,userName,account,phone,orgRegionMaps,delOrgRegionMaps) {
    const data = {
        id,
        userName,
        account,
        phone,
        orgRegionMaps,
        delOrgRegionMaps
    };
    return fetch({
        url: 'bos/agent/saveAgentArea',
        method: 'post',
        data
    });
}
//登录名重复判断
export function findAccountIsExist(account) {
    const data = {
        account
    };
    return fetch({
      url: 'bos/companyStaff/findAccountIsExist',
      method: 'post',
      data
    });
  }

